package com.qu.tabhost.tabs.widget;

import android.content.Context;
import android.support.v4.app.FragmentTabHost;
import android.util.AttributeSet;

/**
 * Created by quguangle on 2017/5/18.
 * 自定义底部TabHost(中间有其他的按钮)
 */

public class MyFragmentTabHost extends FragmentTabHost{
    private String mCurrentTag;
    private String mNoTagChanged;
    public MyFragmentTabHost(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void onTabChanged(String tag) {
        if(tag.equals(mNoTagChanged)){
            setCurrentTabByTag(mCurrentTag);
        }else{
            super.onTabChanged(tag);
            mCurrentTag = tag;
        }
    }
    public void setmNoTagChanged(String tag){
        mNoTagChanged = tag;
    }
}
